import { IFeidaoAiBrowserComponent } from '@dfeidao/atom-web/interfaces';
import fire from '@dfeidao/atom-web/msg/fire';
import error from '@dfeidao/atom-web/msgbox/error';

export default async function a004(fd: IFeidaoAiBrowserComponent) {
	// todo
	// 点击删除按钮时触发
	const chk_list = fd.data.node.querySelectorAll('[data-id="chk-list"]:checked');
	if (chk_list.length < 1) {
		error("请选择一条数据，进行操作!");
	} else {
		const chkList = Array.from(chk_list) as HTMLInputElement[];
		const arr = chkList.map((n) => {
			return n.getAttribute('data-no');
		});
		const nos = arr as string[];
		const flag = 1;
		fire('zj-000005', 'a001', nos, flag);
	}
}
